<template>
    <div>
        <h1>{{$route.query.hello}}</h1>
        <ul>
            <li v-for="(value,key) in getNowItem" :key="key">{{value}}</li>
        </ul>
    </div>
</template>

<script>
export default {
    name: "DetailCom",
    data(){
        return {
            messageList: [{id:1,title:'title001',content:'title001'},{id:2,title:'title002',content:'title002'}]
        }
    },
    computed: {
        getNowItem(){
            return this.messageList.find((item) => {
                return item.id == this.$route.params.id;
            });
        }
    }
}
</script>